{% extends '::base.html.twig' %} 
{% block module_name %}Bodegas{% endblock %}
{% block title %}Bodegas :: Ver{% endblock %}
{% block customScripts %}
<script src="{{ asset('bundles/EndorBundle/js/jquery.dataTables.min.js') }}"></script>
{% endblock %}
{% block body %}
<h2>Bodegas :: Ver Stock</h2>
<div class="widget_inside">
    <div class="form">                <!--<div class="clearfix">
                    <label>Id</label>
                    <div class="input">
                        <input type="text" value="{{ entity.id }}" readonly />
                    </div>
                </div>-->                <div class="clearfix">
                    <label>Nombre</label>
                    <div class="input">
                        <input type="text" value="{{ entity.nombre }}" readonly />
                    </div>
                </div>
                <div class="input">
                    <div class="widget_inside">
                        <h4>Stock</h4>
                        <table class="regular">
                            <thead>
                                <tr>
                                    <th>Articulo</th>
                                    <th>Maximo</th>
                                    <th>Minimo</th>
                                </tr>
                            </thead>
                            <tbody>
                                {%for stock in stocks%}
                                    <tr>
                                        <td>{{stock.Articulo}}</td>
                                        <td>{{stock.max}}</td>
                                        <td>{{stock.min}}</td>
                                    </tr>
                                {%else%}
                                    <tr>
                                        <td colspan="3" class="center">No hay Stock para esta bodega</td>
                                    </tr>
                                {%endfor%}
                            </tbody>
                        </table>
                    </div>
                </div>
        <div class="clearfix grey-highlight">
            <div class="input no-label">
                                    <a href="{{ path('bodegas_edit', { 'id': entity.id }) }}" class="button">Editar</a>
    <form action="{{ path('bodegas_delete', { 'id': entity.id }) }}" method="post" style="display: inline-block;">
        {{ form_widget(delete_form) }}
        <button type="submit" class="button black">Eliminar</button>
    </form>
    <a href="{{ path('bodegas') }}" class="button">Regresar a la Lista</a>
            </div>
        </div>      
    </div>
</div>
<script>
$(document).ready(function(){
    $('.regular').dataTable({
        "sPaginationType": "full_numbers",
        "bJQueryUI": true
    });
});
</script>
{% endblock %}